package com.sxt.generate.util;

/**
 *
 * @ClassName: Configuration
 * @Description:Configuration
 * @version:v1.0.0
 * @author: haning
 * @date:
 */
public class StringTool {

    /*
   * _单词转为驼峰单词
   */
    public static String toCamel(String text) {

        StringBuilder textarr = new StringBuilder(text.toLowerCase());
        for (int i = 0; i < textarr.length() - 1; i++) {
            if (textarr.charAt(i) == '_') {
                int j = i + 1;
                if (j < textarr.length() && textarr.charAt(j) >= 'a' && textarr.charAt(j) <= 'z') {
                    int charInt = (int) textarr.charAt(j) - 32;
                    textarr.setCharAt(j, (char) charInt);
                }

            }
        }
        return textarr.toString().replaceAll("_", "");
    }
}
